<template>
    <div class="mdc-card" >
        <img class="mdc-img" :src="medicineInfo.image_url">
        <div style="width: 22px;"></div>
        <div class="mdc-title">
          <div class="mdc-name">{{ medicineInfo.medicine_name }}</div>
          <div style="height: 8px;"></div>
          <div class="mdc-description">{{ medicineInfo.description }}</div>
        </div>
      </div>
</template>

<script setup lang="ts">
import { MedicineInfo } from '../types.ts';
// 使用defineProps定义接收MedicineInfo类型参数的props
const props = defineProps<{medicineInfo: MedicineInfo}>()
const { medicineInfo } = props;
</script>

<style>
.mdc-card {
    background-color: #fff;
    max-width: 500px;
      width: 100%;
      height: 96px;
      border-radius: 12px;
      box-shadow: 2px 2px 15px 1px rgba(0, 0, 0, 0.04);
      display: flex;
      justify-content: space-between;
      align-items: center;
}
      .mdc-img {
        width: 66px;
        height: 66px;
        margin-left: 14px;
        border-radius: 4px;
      }

      .mdc-title {
        flex:1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
      }

      .mdc-name {
        font-family: PingFang SC;
        font-size: 16px;
        font-weight: 600;
        line-height: 16px;
        text-align: left;
      }

      .mdc-description {
        font-family: PingFang SC;
        font-size: 12px;
        font-weight: 400;
        line-height: 20px;
        text-align: left;
        padding-right: 14px;

      }
</style>